package com.foreknow.elmboot.service.impl;

import com.foreknow.elmboot.mapper.CartMapper;
import com.foreknow.elmboot.po.Cart;
import com.foreknow.elmboot.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CartServiceImpl implements CartService {
    @Autowired
    private CartMapper cartMapper;
    @Override
    public List<Cart> getCart(Integer businessId,String userId) {
        return cartMapper.getCart(businessId,userId);
    }

    @Override
    public int insertCart(Integer cartId, Integer userId,Integer foodId,Integer businessId) {
        return cartMapper.insertCart(cartId,userId,foodId,businessId);
    }

    @Override
    public int updateCart(Integer quantity,Integer userId,Integer foodId,Integer businessId) {
        return cartMapper.updateCart(quantity,userId,foodId,businessId);
    }

    @Override
    public int deleteCart(Cart cart) {
        return cartMapper.deleteCart(cart);
    }
}
